/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @authors: Pat, Jamie, Kazu, Stephen, and Shaoyan
 */
import java.sql.*;
/**
 * 
 * @authors: Pat, Jamie, Kazu, Stephen, and Shaoyan
 */
public class OfficeStaff extends Customer {
    /**
     * 
     * @param customerID
     * @param membershipExpiry
     * @param hoursLeft
     * @param address
     * @param phone
     * @param paymentInfo
     * @param name
     * @param classy
     */
    public OfficeStaff(int customerID, int membershipExpiry, int hoursLeft,
			String address, String phone, String paymentInfo, String name,
				int classy){
		//super(customerID, 0, 0, null, null, null, name, 2);
	}
    /**
     * 
     * @param username
     * @param password
     * @param membershipStartDate
     * @param membershipEndDate
     * @param email
     * @param address
     * @param phone
     * @param userType
     * @param paymentInfo
     */
    public void addUser(String username, String password, int membershipStartDate, int membershipEndDate, String email, String address, String phone, int userType, String paymentInfo){
        DB db = new DB();
        Connection conn = db.connect();
        String query = "INSERT INTO VehicleDB (username,password,membershipStartDate,membershipEndDate,email,address,phonenNumber,userType,paymentInfo) "
                +"VALUES ('" + username
                + "','" + password 
                + "','" + membershipStartDate
                + "','" + membershipEndDate
                + "','" + email
                + "','" + address
                + "','" + phone
                + "','" + userType
                + "','" + paymentInfo
                + "')";
        db.putQuery(conn, query);
        db.disconnect(conn);
    }
        
    /**
     * 
     * @param custID
     * @param email
     * @param address
     * @param phone
     * @param membershipStartDate
     * @param membershipEndDate
     * @param paymentInfo
     */
    public void changeCustomerInfo(int custID, String email, String address, String phone, int membershipStartDate, int membershipEndDate, String paymentInfo){
       DB db = new DB();
        Connection conn = db.connect();
        String query = "UPDATE UserDB SET address = " + address
                +" , phoneNumber = "+ phone
                +" , email = "+email
                +" , membershipStartDate = "+membershipStartDate
                +" , membershipEndDate = "+membershipEndDate
                +" , paymentInfo = "+paymentInfo
                + " WHERE customerId = " + custID;
        db.putQuery(conn, query);
        db.disconnect(conn);
    }
}
